********************************************************************************
********************************************************************************
* Title: 		balance
* Project:		Stress, Ethnicity, and Prosocial Behavior
* Author:		Moritz Poll (moritz.poll@brown.edu)
* PIs:			Johannes Haushofer, Sara Lowes, Abednego Musau, David Ndetei, 
*				Nathan Nunn, Moritz Poll, Nancy Qian
* Purpose:		Balance table
********************************************************************************
********************************************************************************

set more off
set trace off
pause on

noisily dis as input "Start: Balance table"
use "$cleandata_dir/HIO_for_analysis_wide.dta", clear

replace session_totaltime = session_totaltime / 60
replace female = female*100
replace luo = luo*100
replace kikuyu = kikuyu*100
replace luhya = luhya*100
replace kamba = kamba*100
replace pool_kibera = pool_kibera*100
replace pool_kawangware = pool_kawangware*100
replace pool_viwandani = pool_viwandani*100
replace pool_unemployed = pool_unemployed*100
replace pool_selfemployed = pool_selfemployed*100
replace pool_primary = pool_primary*100
replace pool_secondary = pool_secondary*100
replace pool_college = pool_college*100
replace pool_single = pool_single*100
replace pool_married = pool_married*100
replace pool_christianity = pool_christianity*100

iebaltabse female demo_age_years luo kikuyu luhya kamba pool_kibera pool_kawangware pool_viwandani ///
	demo_yearsnairobi demo_income pool_unemployed pool_selfemployed ///
	pool_primary pool_secondary pool_college pool_children pool_married pool_single pool_christianity pool_assets_pca, ///
	rowlabels(female 	Female (%) @ ///
	demo_age_years		Age @ ///
	luo 				Mother tongue: Luo (%) @ ///
	kikuyu 				Mother tongue: Kikuyu (%) @ ///
	luhya 				Mother tongue: Luhya (%) @ ///
	kamba 				Mother tongue: Kamba (%) @ ///
	pool_kibera			From Kibera (%) @ ///
	pool_kawangware		From Kawangware (%) @ ///
	pool_viwandani		From Viwandani (%) @ ///
	demo_yearsnairobi 	Years lived in Nairobi @ ///
	demo_income 		Average monthly income (KES) @ ///
	pool_unemployed		Unemployed (%) @ ///
	pool_selfemployed	Self-employed (%) @ ///
	pool_primary 		Attained some primary education (%) @ ///
	pool_secondary 		Attained some secondary education (%) @ ///
	pool_college 		Attained some college education (%) @ ///
	pool_children 		Number of children @ ///
	pool_married 		Married or cohabiting (%) @ ///
	pool_single 		Single, divorced or widowed (%) @ ///
	pool_christianity 	Christian (%) @ ///
	pool_assets_pca		Principal component of asset list) ///
	grpvar(treatment) control(0) onerow settest ftest pftest format("%9.2f") texnotewidth(0.95) savetex("$tables_dir/balance.tex") replace

noisily dis as input "End: Balance table"
